/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.ProjetoFinal.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author DCBorges
 */
@Entity
@Table(name = "sdctb011_inscricao")
public class Inscricao implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_SQNCL_INSCRICAO")
    private Integer nuSqnclInscricao;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_NIS_LEGAL")
    private long nuNisLegal;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DV_NIS_LEGAL")
    private short dvNisLegal;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_SQNCL_ATND")
    private int nuSqnclAtnd;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IC_RESERVA")
    private char icReserva;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IC_RETORNO")
    private short icRetorno;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nuSqnclInscricao")
    private List<GrupoFamiliar> grupoFamiliarList;
    @OneToMany(mappedBy = "nuSqnclInscricao")
    private List<GrupoRejeicao> grupoRejeicaoList;
    @JoinColumn(name = "NU_SQNCL_INTERFACE", referencedColumnName = "NU_SQNCL_INTERFACE")
    @ManyToOne(optional = false)
    private LoteRemessa nuSqnclInterface;

    public Inscricao() {
    }

    public Inscricao(Integer nuSqnclInscricao) {
        this.nuSqnclInscricao = nuSqnclInscricao;
    }

    public Inscricao(Integer nuSqnclInscricao, long nuNisLegal, short dvNisLegal, int nuSqnclAtnd, char icReserva, short icRetorno) {
        this.nuSqnclInscricao = nuSqnclInscricao;
        this.nuNisLegal = nuNisLegal;
        this.dvNisLegal = dvNisLegal;
        this.nuSqnclAtnd = nuSqnclAtnd;
        this.icReserva = icReserva;
        this.icRetorno = icRetorno;
    }

    public Integer getNuSqnclInscricao() {
        return nuSqnclInscricao;
    }

    public void setNuSqnclInscricao(Integer nuSqnclInscricao) {
        this.nuSqnclInscricao = nuSqnclInscricao;
    }

    public long getNuNisLegal() {
        return nuNisLegal;
    }

    public void setNuNisLegal(long nuNisLegal) {
        this.nuNisLegal = nuNisLegal;
    }

    public short getDvNisLegal() {
        return dvNisLegal;
    }

    public void setDvNisLegal(short dvNisLegal) {
        this.dvNisLegal = dvNisLegal;
    }

    public int getNuSqnclAtnd() {
        return nuSqnclAtnd;
    }

    public void setNuSqnclAtnd(int nuSqnclAtnd) {
        this.nuSqnclAtnd = nuSqnclAtnd;
    }

    public char getIcReserva() {
        return icReserva;
    }

    public void setIcReserva(char icReserva) {
        this.icReserva = icReserva;
    }

    public short getIcRetorno() {
        return icRetorno;
    }

    public void setIcRetorno(short icRetorno) {
        this.icRetorno = icRetorno;
    }

    public List<GrupoFamiliar> getGrupoFamiliarList() {
        return grupoFamiliarList;
    }

    public void setGrupoFamiliarList(List<GrupoFamiliar> grupoFamiliarList) {
        this.grupoFamiliarList = grupoFamiliarList;
    }

    public List<GrupoRejeicao> getGrupoRejeicaoList() {
        return grupoRejeicaoList;
    }

    public void setGrupoRejeicaoList(List<GrupoRejeicao> grupoRejeicaoList) {
        this.grupoRejeicaoList = grupoRejeicaoList;
    }

    public LoteRemessa getNuSqnclInterface() {
        return nuSqnclInterface;
    }

    public void setNuSqnclInterface(LoteRemessa nuSqnclInterface) {
        this.nuSqnclInterface = nuSqnclInterface;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nuSqnclInscricao != null ? nuSqnclInscricao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Inscricao)) {
            return false;
        }
        Inscricao other = (Inscricao) object;
        if ((this.nuSqnclInscricao == null && other.nuSqnclInscricao != null) || (this.nuSqnclInscricao != null && !this.nuSqnclInscricao.equals(other.nuSqnclInscricao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.ProjetoFinal.domain.Inscricao[ nuSqnclInscricao=" + nuSqnclInscricao + " ]";
    }
}
